{% extends "artist-base.html" %}

{% block title %}{{ artist.title }} Discography{% endblock %}

{% block content %}
<h3>{{ album.title }}</h3>
<ul id="tracklisting">
{% for song in album.track_set.all %}
  
  {% if song.text %}
  <li><span class="revealer">{{ song.title }}</span><div class="revealable">{{ song.text|safe }}</div>
  {% else %}
  <li>{{ song.title }}
  {% endif %}
  {% if song.has_lyrics %}
  (<a href="{{ song.get_lyrics_link }}">lyrics</a>)
  {% endif %}
  
  {% if not song.hide_download_link %}
  <a href="{{ song.mp3 }}" class="download-link">download</a>
  {% endif %}
  </li>
{% endfor %}
</ul>
<noscript>This page is nicer with javascript turned on</noscript>
<script type="text/javascript">
//<![CDATA[
var $quote = $('<div id="quote"><\/div>');
$('.revealable').hide().prev().bind('mouseover', function(){
   $('.quoted').removeClass('quoted');
   var text = $(this).addClass('quoted').next().html();
   $quote.empty().append(text);
   $('#tracklisting').after($quote); 
}).bind('mouseout', function() {
   //$('#quote').remove();
});
//]]>
</script>
{% endblock %}
